import requests

from crawler.items import NewsItem


def send_seed(task, title, news_url, pub_date, content, new_path, site_url, list_url, site_name, types):
    if types == 'news':
        news_item = NewsItem()
        news_item['origin'] = task
        news_item['title'] = title[0] if title else ''
        news_item['newsUrl'] = news_url
        news_item['pubDate'] = ' '.join(pub_date) if pub_date else ''
        news_item['content'] = ' '.join(content) if content else ''
        news_item['newsPath'] = new_path
        news_item['siteUrl'] = site_url
        news_item['listUrl'] = list_url
        news_item['siteName'] = site_name
        news_item['comChiNameList'] = list()
        return news_item

